<script>
function displayRoom(room)
{
	document.getElementById(room).style.display = "block";
}
function booking(id, amount)
{
	if (amount < 1)
	{
		return false;
	}
	document.getElementById('book_'+id).href = document.getElementById('tempurl_'+id).value + amount;
}
</script>
<? if($hotel_avaliable): ?>
		<H1>result search hotel</H1>
		Keyword : <?=$info_keyword['keyword']?><BR>
		Date : <?=$info_keyword['date_start']?> TO <?=$info_keyword['date_end']?>
		<? for($i=0; $i<count($hotel_avaliable); $i++): ?>
				<div style="border:solid 1px; width:500px; margin-bottom:5px; padding:10px;">
						<div><A HREF="javascript:void();" onclick="displayRoom('room_<?=$i?>')"><?=$hotel_avaliable[$i]['hotel_name']?></A></div>
						<div><?=$hotel_avaliable[$i]['hotel_description']?></div>
						<div id="room_<?=$i?>" style="display:none; border:solid orange;">
								<div><B>Room name : </B><?=$hotel_avaliable[$i]['rt_name']?></div>
								<div><B>Description : </B><?=$hotel_avaliable[$i]['rt_description']?></div>
								<div><B>Price : </B><?=$hotel_avaliable[$i]['rt_price']?></div>
								<div>
									<B>room : </B>
									<INPUT TYPE="text" NAME="amount_<?=$i?>" id="amount_<?=$i?>" value="1" onkeyup="booking(<?=$i?>,this.value);">
								</div>
								<INPUT TYPE="hidden" NAME="" id="tempurl_<?=$i?>" value="http://<?=$_SERVER['HTTP_HOST']?>/hotelbooking/index.php/booking/book/<?=$hotel_avaliable[$i]['rt_id']?>/<?=$info_keyword['date_start']?>_<?=$info_keyword['date_end']?>/">
								<div>
									<A id="book_<?=$i?>" HREF="http://<?=$_SERVER['HTTP_HOST']?>/hotelbooking/index.php/booking/book/<?=$hotel_avaliable[$i]['rt_id']?>/<?=$info_keyword['date_start']?>_<?=$info_keyword['date_end']?>/1">Book now !</A>
								</div>
						</div>
				</div>
		<? endfor; ?>
<? endif; ?>